@extends('Admin.layouts.common')

@section('content')
    <div class="container myContainer">

        
        <div id="order_tag"></div>

        <div class="table-responsive">
            <table class="table">
                <caption>封禁记录</caption>
                <thead>
                    <tr>
                        <th>Uid</th>
                        <th>操作</th>
                        <th>状态</th>
                        <th>时间</th>
                    </tr>
                </thead>
                <tbody>
                    @forelse($list->items() as $item)
                        <tr id="tr_{{$item->id}}">
                            <td>{{ $item->uid }}</td>
                            <td>{{ $status[$item->status] }}</td>
                            <td>{{ $item->msg }}</td>  
                            <td>{{ date('Y/m/d H:i:s',$item->add_time) }}</td>          
                        </tr>
                    @empty
                        <tr><td class="text-center" colspan="4">没有数据</td></tr>
                    @endforelse
                </tbody>
            </table>
            <div class="text-center">
                {{ $list->links() }}
            </div>
        </div>

    </div>
    <link href="{{ asset('libs/select2/select2.min.css') }}" rel="stylesheet">
<script src="{{ asset('libs/select2/select2.min.js') }}"></script>
<script src="{{ asset('libs/select2/zh-CN.js') }}"></script>
<script type="text/javascript">
$("#uid").select2({
    language: "zh-CN",
    ajax:{
        url: "/Users/ajax_select2_user",
        dataType: 'json',
        delay: 600,
        method: 'POST',
        data: function (params) {
            return {
                name: params.term,
            };
        },
        processResults: function (data, params) {
            return {
                results: data.data,
            };
        },
        cache: true
    },
    placeholder:'请输入手机号码',
    allowClear: true,
    escapeMarkup: function (markup) { return markup; },
    minimumInputLength: 11,
    templateResult: function(repo){ return repo.name; },
    templateSelection: function(repo){ 
        if(repo.id === ""){
            return repo.text
        }else{
            if(repo.selected == true){
                return repo.text
            }
            return repo.name
        }
         
    } 
});

@endsection